home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Exec.mod < prev    next >
Text File  |  1994-08-08  |  56KB  |  1,801 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Exec.mod $
  4.   Description: Interface to exec.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:42:52 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Exec;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT SYS := SYSTEM;
  31.  
  32. (**-- Pointer declarations ---------------------------------------------*)
  33.  
  34. TYPE
  35.  
  36.   MinNodePtr*          = CPOINTER TO MinNode;
  37.   NodePtr*             = CPOINTER TO Node;
  38.   MinListPtr*          = CPOINTER TO MinList;
  39.   ListPtr*             = CPOINTER TO List;
  40.   ResidentPtr*         = CPOINTER TO Resident;
  41.   MemChunkPtr*         = CPOINTER TO MemChunk;
  42.   MemHeaderPtr*        = CPOINTER TO MemHeader;
  43.   MemEntryPtr*         = CPOINTER TO MemEntry;
  44.   MemListPtr*          = CPOINTER TO MemList;
  45.   TaskPtr*             = CPOINTER TO Task;
  46.   StackSwapStructPtr*  = CPOINTER TO StackSwapStruct;
  47.   MsgPortPtr*          = CPOINTER TO MsgPort;
  48.   MsgPortSoftIntPtr*   = CPOINTER TO MsgPortSoftInt;
  49.   MessagePtr*          = CPOINTER TO Message;
  50.   InterruptPtr*        = CPOINTER TO Interrupt;
  51.   IntVectorPtr         = CPOINTER TO IntVector;
  52.   SoftIntListPtr       = CPOINTER TO SoftIntList;
  53.   SemaphoreRequestPtr  = CPOINTER TO SemaphoreRequest;
  54.   SignalSemaphorePtr*  = CPOINTER TO SignalSemaphore;
  55.   SemaphorePtr*        = CPOINTER TO Semaphore;
  56.   LibraryPtr*          = CPOINTER TO Library;
  57.   DevicePtr*           = CPOINTER TO Device;
  58.   UnitPtr*             = CPOINTER TO Unit;
  59.   IORequestPtr*        = CPOINTER TO IORequest;
  60.   IOStdReqPtr*         = CPOINTER TO IOStdReq;
  61.   ExecBasePtr*         = CPOINTER TO ExecBase;
  62.   MemHandlerDataPtr * = CPOINTER TO MemHandlerData;
  63.  
  64.  
  65. (**-- Library definitions ----------------------------------------------*)
  66.  
  67. (*
  68. **      $VER: initializers.h 39.0 (15.10.91)
  69. **
  70. **      Macros for use with the InitStruct() function.
  71. **
  72. **      Not ported.
  73. *)
  74.  
  75. (*
  76. **      $VER: types.h 40.1 (10.8.93)
  77. **
  78. **      Data typing.
  79. *)
  80.  
  81. CONST
  82.  
  83.   includeVersion* = 40; (* Version of the include files in use. (Do not
  84.                           use this label for OpenLibrary() calls!) *)
  85.  
  86. TYPE
  87.  
  88.   (*  WARNING: APTR was redefined for the V36 Includes!  APTR is a   *)
  89.  (*  32-Bit Absolute Memory Pointer.  C pointer math will not       *)
  90. (*  operate on APTR --  use "ULONG *" instead.                     *)
  91.  
  92.   APTR    * = SYS.CPTR;            (* 32-bit untyped pointer *)
  93.   LONG    * = LONGINT;             (* signed 32-bit quantity *)
  94.   ULONG   * = LONGINT;             (* unsigned 32-bit quantity *)
  95.   LONGBITS* = SET;                 (* 32 bits manipulated individually *)
  96.   WORD    * = INTEGER;             (* signed 16-bit quantity *)
  97.   UWORD   * = INTEGER;             (* unsigned 16-bit quantity *)
  98.   WORDBITS* = SYS.WORDSET;         (* 16 bits manipulated individually *)
  99.   BYTE    * = SHORTINT;            (* signed 8-bit quantity *)
  100.   UBYTE   * = SYS.BYTE;            (* unsigned 8-bit quantity *)
  101.   BYTEBITS* = SYS.BYTESET;         (* 8 bits manipulated individually *)
  102.   RPTR    * = INTEGER;             (* signed relative pointer *)
  103.   STRING  * = ARRAY 32767 OF CHAR;
  104.   STRPTR  * = CPOINTER TO STRING;  (* string pointer (NULL terminated) *)
  105.   LSTRPTR * = STRPTR;
  106.  
  107.  
  108. (* For compatibility only: (don't use in new code) *)
  109.   SHORT   * = INTEGER;             (* signed 16-bit quantity (use WORD) *)
  110.   USHORT  * = INTEGER;             (* unsigned 16-bit quantity (use UWORD) *)
  111.   COUNT   * = INTEGER;
  112.   UCOUNT  * = INTEGER;
  113.   CPTR    * = ULONG;
  114.  
  115.  
  116. (* Types with specific semantics *)
  117.   FLOAT   * = REAL;
  118.   DOUBLE  * = ARRAY 2 OF SYS.LONGWORD;
  119.   SINGLE  * = SYS.LONGWORD;
  120.   BOOL    * = INTEGER;
  121.   TEXT    * = CHAR;
  122.  
  123. CONST
  124.  
  125.   NULL           * = NIL;
  126.   byteMask       * = 0FFH;
  127.  
  128. (* Types convenient for Oberon-A programmers *)
  129.  
  130. TYPE
  131.  
  132.   PROC     * = PROCEDURE;
  133.   LBOOL    * = LONGINT;
  134.   LONGBOOL * = LBOOL;
  135.   BSET     * = SYS.BYTESET;
  136.   WSET     * = SYS.WORDSET;
  137.  
  138. (* Legal values for LBOOL types *)
  139.  
  140. CONST
  141.  
  142.   LFALSE * = 0;
  143.   LTRUE  * = 1;
  144.  
  145.  (*   libraryVersion is now obsolete.  Please use libraryMinimum *)
  146. (* or code the specific minimum library version you require.            *)
  147.  
  148.   libraryMinimum* = 33; (* Lowest version supported by Commodore-Amiga *)
  149.  
  150. (*
  151. **      $VER: nodes.h 39.0 (15.10.91)
  152. **
  153. **      Nodes & Node type identifiers.
  154. *)
  155.  
  156. TYPE
  157.  
  158. (*
  159.  *  List Node Structure.  Each member in a list starts with a Node
  160.  *)
  161.  
  162. (* minimal node -- no type checking possible *)
  163.   MinNode* = RECORD
  164.     succ* : MinNodePtr;      (* Pointer to next (successor) *)
  165.     pred* : MinNodePtr;      (* Pointer to previous (predecessor) *)
  166.   END; (* MinNode *)
  167.  
  168.   Node* = RECORD (MinNode)
  169.     type* : UBYTE;
  170.     pri*  : SHORTINT;  (* Priority, for sorting *)
  171.     name* : STRPTR;    (* ID string, null terminated *)
  172.   END; (* Node *)      (* Note: word aligned *)
  173.  
  174.  
  175. CONST
  176.  
  177. (*
  178. ** Note: Newly initialized IORequests, and software interrupt structures
  179. ** used with Cause(), should have type ntUNKNOWN.  The OS will assign a type
  180. ** when they are first used.
  181. *)
  182. (* ----- Node Types for Node.type -----*)
  183.   ntUnknown     * = 0;
  184.   ntTask        * = 1;       (* Exec task *)
  185.   ntInterrupt   * = 2;
  186.   ntDevice      * = 3;
  187.   ntMsgPort     * = 4;
  188.   ntMessage     * = 5;       (* Indicates message currently pending *)
  189.   ntFreeMsg     * = 6;
  190.   ntReplyMsg    * = 7;       (* Message has been replied *)
  191.   ntResource    * = 8;
  192.   ntLibrary     * = 9;
  193.   ntMemory      * = 10;
  194.   ntSoftInt     * = 11;      (* Internal flag used by SoftInits *)
  195.   ntFont        * = 12;
  196.   ntProcess     * = 13;      (* AmigaDOS Process *)
  197.   ntSemaphore   * = 14;
  198.   ntSignalSem   * = 15;      (* signal semaphores *)
  199.   ntBootNode    * = 16;
  200.   ntKickMem     * = 17;
  201.   ntGraphics    * = 18;
  202.   ntDeathMessage* = 19;
  203.   ntUser        * = 254;     (* User node types work down from here *)
  204.   ntExtended    * = 255;
  205.  
  206. (*
  207. **      $VER: lists.h 39.0 (15.10.91)
  208. **
  209. **      Definitions and macros for use with Exec lists
  210. *)
  211.  
  212. TYPE
  213.  
  214. (*
  215.  * Minimal List Header - no type checking
  216.  *)
  217.   MinList* = RECORD
  218.     head*     : MinNodePtr;
  219.     tail*     : MinNodePtr;
  220.     tailPred* : MinNodePtr;
  221.   END; (* MinList *)      (* longword aligned *)
  222.  
  223. (*
  224.  *  Full featured list header.
  225.  *)
  226.   List* = RECORD (MinList)
  227.    type*     : UBYTE;
  228.    pad*      : UBYTE;
  229.   END; (* List *)      (* word aligned *)
  230.  
  231.  
  232. (*
  233. **      $VER: alerts.h 39.3 (12.5.92)
  234. **
  235. **      Alert numbers, as displayed by system crashes.
  236. *)
  237.  
  238. (*********************************************************************
  239. *
  240. *  Format of the alert error number:
  241. *
  242. *    +-+-------------+----------------+--------------------------------+
  243. *    |D|  SubSysId   |  General Error |    SubSystem Specific Error    |
  244. *    +-+-------------+----------------+--------------------------------+
  245. *     1    7 bits          8 bits                  16 bits
  246. *
  247. *                    D:  DeadEnd alert
  248. *             SubSysId:  indicates ROM subsystem number.
  249. *        General Error:  roughly indicates what the error was
  250. *       Specific Error:  indicates more detail
  251. **********************************************************************)
  252.  
  253. (**********************************************************************
  254. *
  255. *  Hardware/CPU specific alerts:  They may show without the 8 at the
  256. *  front of the number.  These are CPU/68000 specific.  See 680x0
  257. *  programmer's manuals for more details.
  258. *
  259. **********************************************************************)
  260.  
  261. CONST
  262.  
  263.   acpuBusErr     * = 080000002H;  (* Hardware bus fault/access error *)
  264.   acpuAddressErr * = 080000003H;  (* Illegal address access (ie: odd) *)
  265.   acpuInstErr    * = 080000004H;  (* Illegal instruction *)
  266.   acpuDivZero    * = 080000005H;  (* Divide by zero *)
  267.   acpuCHK        * = 080000006H;  (* Check instruction error *)
  268.   acpuTRAPV      * = 080000007H;  (* TrapV instruction error *)
  269.   acpuPrivErr    * = 080000008H;  (* Privilege violation error *)
  270.   acpuTrace      * = 080000009H;  (* Trace error *)
  271.   acpuLineA      * = 08000000AH;  (* Line 1010 Emulator error *)
  272.   acpuLineF      * = 08000000BH;  (* Line 1111 Emulator error *)
  273.   acpuFormat     * = 08000000EH;  (* Stack frame format error *)
  274.   acpuSpurious   * = 080000018H;  (* Spurious interrupt error *)
  275.   acpuAutoVec1   * = 080000019H;  (* AutoVector Level 1 interrupt error *)
  276.   acpuAutoVec2   * = 08000001AH;  (* AutoVector Level 2 interrupt error *)
  277.   acpuAutoVec3   * = 08000001BH;  (* AutoVector Level 3 interrupt error *)
  278.   acpuAutoVec4   * = 08000001CH;  (* AutoVector Level 4 interrupt error *)
  279.   acpuAutoVec5   * = 08000001DH;  (* AutoVector Level 5 interrupt error *)
  280.   acpuAutoVec6   * = 08000001EH;  (* AutoVector Level 6 interrupt error *)
  281.   acpuAutoVec7   * = 08000001FH;  (* AutoVector Level 7 interrupt error *)
  282.  
  283. (*********************************************************************
  284. *
  285. *  General Alerts
  286. *
  287. *  For example: timer.device cannot open math.library would be 05038015H
  288. *
  289. *       alert(an_timerdev|ag_openlib|ao_MathLib);
  290. *
  291. *********************************************************************)
  292.  
  293. CONST
  294.  
  295. (* ------ alert types *)
  296.   atDeadEnd     * = 80000000H;
  297.   atRecovery    * = 00000000H;
  298.  
  299.  
  300. (* ------ general purpose alert codes *)
  301.   agNoMemory    * = 00010000H;
  302.   agMakeLib     * = 00020000H;
  303.   agOpenLib     * = 00030000H;
  304.   agOpenDev     * = 00040000H;
  305.   agOpenRes     * = 00050000H;
  306.   agIoError     * = 00060000H;
  307.   agNoSignal    * = 00070000H;
  308.   agBadParm     * = 00080000H;
  309.   agCloseLib    * = 00090000H;      (* usually too many closes *)
  310.   agCloseDev    * = 000A0000H;      (* or a mismatched close *)
  311.   agProcCreate  * = 000B0000H;      (* Process creation failed *)
  312.  
  313.  
  314. (* ------ alert objects: *)
  315.   aoExecLib     * = 00008001H;
  316.   aoGraphicsLib * = 00008002H;
  317.   aoLayersLib   * = 00008003H;
  318.   aoIntuition   * = 00008004H;
  319.   aoMathLib     * = 00008005H;
  320.   aoDosLib      * = 00008007H;
  321.   aoRamLib      * = 00008008H;
  322.   aoIconLib     * = 00008009H;
  323.   aoExpansionLib* = 0000800AH;
  324.   aoDiskfontLib * = 0000800BH;
  325.   aoUtilityLib  * = 0000800CH;
  326.   aoKeyMapLib   * = 0000800DH;
  327.  
  328.   aoAudioDev    * = 00008010H;
  329.   aoConsoleDev  * = 00008011H;
  330.   aoGamePortDev * = 00008012H;
  331.   aoKeyboardDev * = 00008013H;
  332.   aoTrackDiskDev* = 00008014H;
  333.   aoTimerDev    * = 00008015H;
  334.  
  335.   aoCiaRsrc     * = 00008020H;
  336.   aoDiskRsrc    * = 00008021H;
  337.   aoMiscRsrc    * = 00008022H;
  338.  
  339.   aoBootStrap   * = 00008030H;
  340.   aoWorkbench   * = 00008031H;
  341.   aoDiskCopy    * = 00008032H;
  342.   aoGadTools    * = 00008033H;
  343.   aoUnknown     * = 00008035H;
  344.  
  345.  
  346.  
  347. (*********************************************************************
  348. *
  349. *   Specific Alerts:
  350. *
  351. *********************************************************************)
  352.  
  353. (* ------ exec.library *)
  354.   anExecLib     * = 01000000H;
  355.   anExcptVect   * = 01000001H; (* 68000 exception vector checksum (obs.) *)
  356.   anBaseChkSum  * = 01000002H; (* Execbase checksum (obs.) *)
  357.   anLibChkSum   * = 01000003H; (* Library checksum failure *)
  358.  
  359.   anMemCorrupt  * = 81000005H; (* Corrupt memory list detected in FreeMem *)
  360.   anIntrMem     * = 81000006H; (* No memory for interrupt servers *)
  361.   anInitAPtr    * = 01000007H; (* InitStruct() of an APTR source (obs.) *)
  362.   anSemCorrupt  * = 01000008H; (* A semaphore is in an illegal state
  363.                                       at ReleaseSempahore() *)
  364.   anFreeTwice   * = 01000009H; (* Freeing memory already freed *)
  365.   anBogusExcpt  * = 8100000AH; (* illegal 68k exception taken (obs.) *)
  366.   anIOUsedTwice * = 0100000BH; (* Attempt to reuse active IORequest *)
  367.   anMemoryInsane* = 0100000CH; (* Sanity check on memory list failed
  368.                                       during availmem(memfLARGEST) *)
  369.   anIOAfterClose* = 0100000DH; (* IO attempted on closed IORequest *)
  370.   anStackProbe  * = 0100000EH; (* Stack appears to extend out of range *)
  371.   anBadFreeAddr * = 0100000FH; (* Memory header not located. [ Usually an
  372.                                       invalid address passed to FreeMem() ] *)
  373.   anBadSemaphore* = 01000010H; (* An attempt was made to use the old
  374.                                   message semaphores. *)
  375.  
  376. (* ------ graphics.library *)
  377.   anGraphicsLib * = 02000000H;
  378.   anGfxNoMem    * = 82010000H;      (* graphics out of memory *)
  379.   anGfxNoMemMspc* = 82010001H;      (* MonitorSpec alloc, no memory *)
  380.   anLongFrame   * = 82010006H;      (* long frame, no memory *)
  381.   anShortFrame  * = 82010007H;      (* short frame, no memory *)
  382.   anTextTmpRas  * = 02010009H;      (* text, no memory for TmpRas *)
  383.   anBltBitMap   * = 8201000AH;      (* BltBitMap, no memory *)
  384.   anRegionMemory* = 8201000BH;      (* regions, memory not available *)
  385.   anMakeVPort   * = 82010030H;      (* MakeVPort, no memory *)
  386.   anGfxNewError * = 0200000CH;
  387.   anGfxFreeError* = 0200000DH;
  388.  
  389.   anGfxNoLCM    * = 82011234H;      (* emergency memory not available *)
  390.  
  391.   anObsoleteFont* = 02000401H;      (* unsupported font description used *)
  392.  
  393. (* ------ layers.library *)
  394.   anLayersLib   * = 03000000H;
  395.   anLayersNoMem * = 83010000H;      (* layers out of memory *)
  396.  
  397. (* ------ intuition.library *)
  398.   anIntuition   * = 04000000H;
  399.   anGadgetType  * = 84000001H;      (* unknown gadget type *)
  400.   anBadGadget   * = 04000001H;      (* Recovery form of GadgetType *)
  401.   anCreatePort  * = 84010002H;      (* create port, no memory *)
  402.   anItemAlloc   * = 04010003H;      (* item plane alloc, no memory *)
  403.   anSubAlloc    * = 04010004H;      (* sub alloc, no memory *)
  404.   anPlaneAlloc  * = 84010005H;      (* plane alloc, no memory *)
  405.   anItemBoxTop  * = 84000006H;      (* item box top < RelZero *)
  406.   anOpenScreen  * = 84010007H;      (* open screen, no memory *)
  407.   anOpenScrnRast* = 84010008H;      (* open screen, raster alloc, no memory *)
  408.   anSysScrnType * = 84000009H;      (* open sys screen, unknown type *)
  409.   anAddSWGadget * = 8401000AH;      (* add SW gadgets, no memory *)
  410.   anOpenWindow  * = 8401000BH;      (* open window, no memory *)
  411.   anBadState    * = 8400000CH;      (* Bad State Return entering Intuition *)
  412.   anBadMessage  * = 8400000DH;      (* Bad Message received by IDCMP *)
  413.   anWeirdEcho   * = 8400000EH;      (* Weird echo causing incomprehension *)
  414.   anNoConsole   * = 8400000FH;      (* couldn't open the Console Device *)
  415.   anNoISem      * = 004000010H;     (* Intuition skipped obtaining a sem *)
  416.   anISemOrder   * = 004000011H;     (* Intuition obtained a sem in bad order *)
  417.  
  418. (* ------ math.library *)
  419.   anMathLib     * = 05000000H;
  420.  
  421. (* ------ dos.library *)
  422.   anDosLib      * = 07000000H;
  423.   anStartMem    * = 07010001H; (* no memory at startup *)
  424.   anEndTask     * = 07000002H; (* EndTask didn't *)
  425.   anQPktFail    * = 07000003H; (* Qpkt failure *)
  426.   anAsyncPkt    * = 07000004H; (* Unexpected packet received *)
  427.   anFreeVec     * = 07000005H; (* Freevec failed *)
  428.   anDiskBlkSeq  * = 07000006H; (* Disk block sequence error *)
  429.   anBitMap      * = 07000007H; (* Bitmap corrupt *)
  430.   anKeyFree     * = 07000008H; (* Key already free *)
  431.   anBadChkSum   * = 07000009H; (* Invalid checksum *)
  432.   anDiskError   * = 0700000AH; (* Disk Error *)
  433.   anKeyRange    * = 0700000BH; (* Key out of range *)
  434.   anBadOverlay  * = 0700000CH; (* Bad overlay *)
  435.   anBadInitFunc * = 0700000DH; (* Invalid init packet for cli/shell *)
  436.   anFileReclosed* = 0700000EH; (* A filehandle was closed more than once *)
  437.  
  438. (* ------ ramlib.library *)
  439.   anRAMLib      * = 08000000H;
  440.   anBadSegList  * = 08000001H;      (* no overlays in library seglists *)
  441.  
  442. (* ------ icon.library *)
  443.   anIconLib     * = 09000000H;
  444.  
  445. (* ------ expansion.library *)
  446.   anExpansionLib* = 0A000000H;
  447.   anBadExpansionFree    * = 0A000001H; (* freeed free region *)
  448.  
  449. (* ------ diskfont.library *)
  450.   anDiskfontLib * = 0B000000H;
  451.  
  452. (* ------ audio.device *)
  453.   anAudioDev    * = 10000000H;
  454.  
  455. (* ------ console.device *)
  456.   anConsoleDev  * = 11000000H;
  457.   anNoWindow    * = 11000001H;      (* Console can't open initial window *)
  458.  
  459. (* ------ gameport.device *)
  460.   anGamePortDev * = 12000000H;
  461.  
  462. (* ------ keyboard.device *)
  463.   anKeyboardDev * = 13000000H;
  464.  
  465. (* ------ trackdisk.device *)
  466.   anTrackDiskDev* = 14000000H;
  467.   anTDCalibSeek * = 14000001H;      (* calibrate: seek error *)
  468.   anTDDelay     * = 14000002H;      (* delay: error on timer wait *)
  469.  
  470. (* ------ timer.device *)
  471.   anTimerDev    * = 15000000H;
  472.   anTMBadReq    * = 15000001H; (* bad request *)
  473.   anTMBadSupply * = 15000002H; (* power supply -- no 50/60Hz ticks *)
  474.  
  475. (* ------ cia.resource *)
  476.   anCIARsrc     * = 20000000H;
  477.  
  478. (* ------ disk.resource *)
  479.   anDiskRsrc    * = 21000000H;
  480.   anDRHasDisk   * = 21000001H;      (* get unit: already has disk *)
  481.   anDRIntNoAct  * = 21000002H;      (* interrupt: no active unit *)
  482.  
  483. (* ------ misc.resource *)
  484.   anMiscRsrc    * = 22000000H;
  485.  
  486. (* ------ bootstrap *)
  487.   anBootStrap   * = 30000000H;
  488.   anBootError   * = 30000001H;      (* boot code returned an error *)
  489.  
  490. (* ------ Workbench *)
  491.   anWorkbench                   * = 31000000H;
  492.   anNoFonts                     * = 0B1000001H;
  493.   anWBBadStartupMsg1            * = 31000001H;
  494.   anWBBadStartupMsg2            * = 31000002H;
  495.   anWBBadIOMsg                  * = 31000003H;
  496.   anWBReLayoutToolMenu          * = 0B1010009H;
  497.  
  498.   (* The following are in the V37 includes, but not the V40 *)
  499.  
  500.   anWBInitPotionAllocDrawer     * = 0B1010004H;
  501.   anWBCreateWBMenusCreateMenus1 * = 0B1010005H;
  502.   anWBCreateWBMenusCreateMenus2 * = 0B1010006H;
  503.   anWBLayoutWBMenusLayoutMenus  * = 0B1010007H;
  504.   anWBAddToolMenuItem           * = 0B1010008H;
  505.   anWBinitTimer                 * = 0B101000AH;
  506.   anWBInitLayerDemon            * = 0B101000BH;
  507.   anWBinitWbGels                * = 0B101000CH;
  508.   anWBInitScreenAndWindows1     * = 0B101000DH;
  509.   anWBInitScreenAndWindows2     * = 0B101000EH;
  510.   anWBInitScreenAndWindows3     * = 0B101000FH;
  511.   anWBMAlloc                    * = 0B1010010H;
  512.  
  513. (* ------ DiskCopy *)
  514.   anDiskCopy    * = 32000000H;
  515.  
  516. (* ------ toolkit for Intuition *)
  517.   anGadTools    * = 33000000H;
  518.  
  519. (* ------ System utility library *)
  520.   anUtilityLib  * = 34000000H;
  521.  
  522. (* ------ For use by any application that needs it *)
  523.   anUnknown     * = 35000000H;
  524.  
  525. (*
  526. **      $VER: errors.h 39.0 (15.10.91)
  527. **
  528. **      Standard Device IO Errors (returned in ioError)
  529. *)
  530.  
  531.   ioErrOpenFail  * = -1; (* device/unit failed to open *)
  532.   ioErrAborted   * = -2; (* request terminated early [after AbortIO()] *)
  533.   ioErrNoCmd     * = -3; (* command not supported by device *)
  534.   ioErrBadLength * = -4; (* not a valid length (usually ioLENGTH) *)
  535.   ioErrBadAddress* = -5; (* invalid address (misaligned or bad range) *)
  536.   ioErrUnitBusy  * = -6; (* device opens ok, but requested unit is busy *)
  537.   ioErrSelfTest  * = -7; (* hardware failed self-test *)
  538.  
  539.  
  540. (*
  541. **      $VER: resident.h 39.0 (15.10.91)
  542. **
  543. **      Resident/ROMTag stuff.  Used to identify and initialize code modules.
  544. *)
  545.  
  546.  
  547. TYPE
  548.  
  549.   Resident* = RECORD
  550.     matchWord* : UWORD;          (* word to match on (ILLEGAL)       *)
  551.     matchTag*  : ResidentPtr;    (* pointer to the above             *)
  552.     endSkip*   : APTR;           (* address to continue scan         *)
  553.     flags*     : BSET;           (* various tag flags                *)
  554.     version*   : UBYTE;          (* release version number           *)
  555.     type*      : UBYTE;          (* type of module (ntXXXXXX)        *)
  556.     pri*       : SHORTINT;       (* initialization priority          *)
  557.     name*      : STRPTR;         (* pointer to node name             *)
  558.     idString*  : STRPTR;         (* pointer to identification string *)
  559.     init*      : APTR;           (* pointer to init code             *)
  560.   END; (* Resident *)
  561.  
  562. CONST
  563.  
  564.   matchWord  * = 4AFCH;  (* The 68000 "ILLEGAL" instruction *)
  565.  
  566.   rtAutoInit   * = 7;  (* Resident.init points to data structure *)
  567.   rtAfterDos   * = 2;
  568.   rtSingleTask * = 1;
  569.   rtColdStart  * = 0;
  570.  
  571.   rtNever      * = {};
  572.  
  573. (*
  574. **      $VER: memory.h 39.3 (21.5.92)
  575. **
  576. **      Definitions and structures used by the memory allocation system
  577. *)
  578.  
  579. TYPE
  580.  
  581. (****** MemChunk ****************************************************)
  582.  
  583.   MemChunk* = RECORD
  584.     next*  : MemChunkPtr;  (* pointer to next chunk *)
  585.     bytes* : ULONG;        (* chunk byte size       *)
  586.   END; (* MemChunk *)
  587.  
  588.  
  589. (****** MemHeader ***************************************************)
  590.  
  591.   MemHeader* = RECORD (Node)
  592.     attributes* : WSET;         (* characteristics of this region *)
  593.     first*      : MemChunkPtr;  (* first free region              *)
  594.     lower*      : APTR;         (* lower memory bound             *)
  595.     upper*      : APTR;         (* upper memory bound+1           *)
  596.     free*       : ULONG;        (* total number of free bytes     *)
  597.   END; (* MemHeader *)
  598.  
  599.  
  600. (****** MemEntry ****************************************************)
  601.  
  602.   MemEntry* = RECORD
  603.     addr *   : APTR;           (* the address of this memory region *)
  604.  (** reqs *   : SET;            (* the AllocMem requirements         *)
  605.   *
  606.   * This occupies the same space as addr (a C union).  Access via:
  607.   *   SYS.VAL (SET, MemEntry.addr)
  608.   *)
  609.     length * : ULONG;          (* the length of this memory region  *)
  610.   END; (* MemEntry *)
  611.  
  612. (****** MemList *****************************************************)
  613.  
  614. (* Note: SIZE (MemList) includes the size of the first MemEntry!
  615.    No it doesn't !!  This is *Oberon*, not C !! *)
  616.  
  617.   MemList* = RECORD (Node)
  618.     numEntries * : UWORD;             (* number of entries in this struct *)
  619.   (*me         * : ARRAY OF MemEntry; (* the first entry      *)*)
  620.   END; (* MemList *)
  621.  
  622. CONST
  623.  
  624. (* ----- Memory Requirement Types ---------------------------*)
  625. (* ----- See the AllocMem() documentation for details--------*)
  626.  
  627.   memAny      * = {};   (* Any type of memory will do *)
  628.   memPublic   * = 0;
  629.   memChip     * = 1;
  630.   memFast     * = 2;
  631.   memLocal    * = 8;    (* Memory that does not go away at RESET *)
  632.   mem24BitDMA * = 9;    (* DMAable memory within 24 bits of address *)
  633.   memKick     * = 10;   (* Memory that can be used for KickTags *)
  634.  
  635.   memClear    * = 16;   (* AllocMem: NULL out area before return *)
  636.   memLargest  * = 17;   (* AvailMem: return the largest chunk size *)
  637.   memReverse  * = 18;   (* AllocMem: allocate from the top down *)
  638.   memTotal    * = 19;   (* AvailMem: return total size of memory *)
  639.  
  640.   memNoExpunge* = 31;   (*AllocMem: Do not cause expunge on failure *)
  641.  
  642. (* ----- Current alignment rules for memory blocks (may increase) -----*)
  643.   memBlockSize  * = 8;
  644.   memBlockMask  * = (memBlockSize-1);
  645.  
  646. TYPE
  647.  
  648. (****** MemHandlerData **********************************************)
  649. (* Note:  This structure is *READ ONLY* and only EXEC can create it!*)
  650.   MemHandlerData * = RECORD
  651.     requestSize  * :  ULONG;  (* Requested allocation size *)
  652.     requestFlags * :  SET;    (* Requested allocation flags *)
  653.     flags        * :  SET;    (* Flags (see below) *)
  654.   END;
  655.  
  656. CONST
  657.  
  658.   memhRecycle * = 0;       (* 0==First time, 1==recycle *)
  659.  
  660. (****** Low Memory handler return values ***************************)
  661.   memDidNothing * = 0;   (* Nothing we could do... *)
  662.   memAllDone    * = -1;  (* We did all we could do *)
  663.   memTryAgain   * = 1;   (* We did some, try the allocation again *)
  664.  
  665. (*
  666. **      $VER: tasks.h 39.3 (18.9.92)
  667. **
  668. **      Task Control Block, Singals, and Task flags.
  669. *)
  670.  
  671. TYPE
  672.  
  673. (* Please use Exec functions to modify task structure fields, where available.
  674.  *)
  675.   Task* = RECORD (Node)
  676.     tcFlags*    : BSET;
  677.     state*      : BSET;
  678.     idNestCnt*  : SHORTINT;   (* intr disabled nesting*)
  679.     tdNestCnt*  : SHORTINT;   (* task disabled nesting*)
  680.     sigAlloc*   : SET;        (* sigs allocated *)
  681.     sigWait*    : SET;        (* sigs we are waiting for *)
  682.     sigRecvd*   : SET;        (* sigs we have received *)
  683.     sigExcept*  : SET;        (* sigs we will take excepts for *)
  684.     trapAlloc*  : WSET;       (* traps allocated *)
  685.     trapAble*   : WSET;       (* traps enabled *)
  686.     exceptData* : APTR;       (* points to except data *)
  687.     exceptCode* : PROC;       (* points to except code *)
  688.     trapData*   : APTR;       (* points to trap code *)
  689.     trapCode*   : PROC;       (* points to trap data *)
  690.     spReg*      : APTR;       (* stack pointer        *)
  691.     spLower*    : APTR;       (* stack lower bound    *)
  692.     spUpper*    : APTR;       (* stack upper bound + 2*)
  693.     switch*     : PROC;       (* task losing CPU    *)
  694.     launch*     : PROC;       (* task getting CPU  *)
  695.     memEntry*   : List;       (* Allocated memory. Freed by RemTask() *)
  696.     userData*   : APTR;       (* For use by the task; no restrictions! *)
  697.   END; (* Task *)
  698.  
  699. (*
  700.  * Stack swap structure as passed to StackSwap()
  701.  *)
  702.   StackSwapStruct* = RECORD
  703.     lower*   : APTR;    (* Lowest byte of stack *)
  704.     upper*   : ULONG;   (* Upper end of stack (size + Lowest) *)
  705.     pointer* : APTR;    (* Stack pointer at switch point *)
  706.   END; (* StackSwapStruct *)
  707.  
  708. CONST
  709.  
  710. (* ----- Flag Bits ------------------------------------------*)
  711.   tProcTime    * = 0;
  712.   tETask       * = 3;
  713.   tStackChk    * = 4;
  714.   tException   * = 5;
  715.   tSwitch      * = 6;
  716.   tLaunch      * = 7;
  717.  
  718. (* ----- Task States ----------------------------------------*)
  719.   tsInvalid     * = 0;
  720.   tsAdded       * = 1;
  721.   tsRun         * = 2;
  722.   tsReady       * = 3;
  723.   tsWait        * = 4;
  724.   tsExcept      * = 5;
  725.   tsRemoved     * = 6;
  726.  
  727. (* ----- Predefined Signals -------------------------------------*)
  728.   sigAbort     * = 0;
  729.   sigChild     * = 1;
  730.   sigBlit      * = 4;       (* Note: same as SINGLE *)
  731.   sigSingle    * = 4;       (* Note: same as BLIT *)
  732.   sigIntuition * = 5;
  733.   sigNet       * = 7;
  734.   sigDos       * = 8;
  735.  
  736. (*
  737. **      $VER: ports.h 39.0 (15.10.91)
  738. **
  739. **      Message ports and Messages.
  740. *)
  741.  
  742. TYPE
  743.  
  744. (****** MsgPort *****************************************************)
  745.  
  746.   MsgPort* = RECORD (Node)
  747.     mpFlags* : BSET;
  748.     sigBit*  : SHORTINT;(* signal bit number    *)
  749.     sigTask* : TaskPtr; (* object to be signalled *)
  750.     msgList* : List;    (* message linked list  *)
  751.   END; (* MsgPort *)
  752.  
  753.   MsgPortSoftInt* = RECORD (Node)
  754.     mpFlags* : BSET;
  755.     sigBit*  : SHORTINT;     (* signal bit number    *)
  756.     softInt* : InterruptPtr; (* object to be signalled *)
  757.     msgList* : List;         (* message linked list  *)
  758.   END; (* MsgPort *)
  759.  
  760. CONST
  761.  
  762. (* MsgPort.flags: Port arrival actions (PutMsg) *)
  763.   pfAction    * = {0,1};   (* Mask *)
  764.   paSignal    * = {};      (* Signal task in mpSigTask *)
  765.   paSoftint   * = {0};     (* Signal SoftInt in mpsoftint/mpSigTask *)
  766.   paIgnore    * = {1};     (* Ignore arrival *)
  767.  
  768.  
  769. TYPE
  770.  
  771. (****** Message *****************************************************)
  772.  
  773.   Message* = RECORD (Node)
  774.     replyPort* : MsgPortPtr;  (* message reply port *)
  775.     mnLength*  : UWORD;       (* total message length, in bytes *)
  776.                               (* (include the size of the Message *)
  777.                               (* structure in the length) *)
  778.   END; (* Message *)
  779.  
  780. (*
  781. **      $VER: interrupts.h 39.1 (18.9.92)
  782. **
  783. **      Callback structures used by hardware & software interrupts
  784. *)
  785.  
  786. TYPE
  787.  
  788.   Interrupt* = RECORD (Node)
  789.     data* : APTR;                (* server data segment  *)
  790.     code* : PROC;                (* server code entry    *)
  791.   END; (* Interrupt *)
  792.  
  793.  
  794.   IntVector = RECORD            (* For EXEC use ONLY! *)
  795.     data : APTR;
  796.     code : PROC;
  797.     node : NodePtr;
  798.   END; (* IntVector *)
  799.  
  800.  
  801.   SoftIntList = RECORD (List)   (* For EXEC use ONLY! *)
  802.     shPad  : UWORD;
  803.   END; (* SoftIntList *)
  804.  
  805. CONST
  806.  
  807.   sihPriMask* = 0F0H;
  808.  
  809. (* this is a fake INT definition, used only for AddIntServer and the like *)
  810.   intNMI     * = 15;
  811.  
  812. (*
  813. **      $VER: semaphores.h 39.1 (7.2.92)
  814. **
  815. **      Definitions for locking functions.
  816. *)
  817.  
  818. TYPE
  819.  
  820. (****** SignalSemaphore *********************************************)
  821.  
  822. (* Private structure used by ObtainSemaphore() *)
  823.   SemaphoreRequest = RECORD (MinNode)
  824.     waiter : TaskPtr;
  825.   END; (* SemaphoreRequest *)
  826.  
  827. (* Signal Semaphore data structure *)
  828.   SignalSemaphore* = RECORD (Node)
  829.     nestCount*    : INTEGER;
  830.     waitQueue*    : MinList;
  831.     multipleLink  : SemaphoreRequest;
  832.     owner*        : TaskPtr;
  833.     queueCount*   : INTEGER;
  834.   END; (* SignalSemaphore *)
  835.  
  836. (****** Semaphore procure message (for use in V39 Procure/Vacate ****)
  837.   SemaphoreMessage * = RECORD (Message)
  838.     semaphore * :  SignalSemaphorePtr;
  839.   END;
  840.  
  841. CONST
  842.  
  843.   smShared    * = 1;
  844.   smExclusive * = 0;
  845.  
  846. TYPE
  847.  
  848. (****** Semaphore (Old Procure/Vacate type, not reliable) ***********)
  849.  
  850.   Semaphore* = RECORD (MsgPort) (* Do not use these semaphores! *)
  851.     bids*    : INTEGER;
  852.   END; (* Semaphore *)
  853.  
  854.  
  855. (*
  856. **      $VER: libraries.h 39.2 (10.4.92)
  857. **
  858. **      Definitions for use when creating or using Exec libraries
  859. *)
  860.  
  861.  
  862. CONST
  863.  
  864. (* ------ Special Constants ---------------------------------------*)
  865.   libVectSize   * = 6;       (* Each library entry takes 6 bytes *)
  866.   libReserved   * = 4;       (* Exec reserves the first 4 vectors *)
  867.   libBase       * = (-libVectSize);
  868.   libUserDef    * = (libBase-(libReserved*libVectSize));
  869.   libNonStd     * = (libUserDef);
  870.  
  871. (* ------ Standard Functions --------------------------------------*)
  872.   libOpen       * = -6;
  873.   libClose      * = -12;
  874.   libExpunge    * = -18;
  875.   libExtFunc    * = -24;   (* for future expansion *)
  876.  
  877. TYPE
  878.  
  879. (* ------ Library Base Structure ----------------------------------*)
  880. (* Also used for Devices and some Resources *)
  881.   Library* = RECORD (Node)
  882.     libFlags* : BSET;
  883.     pad*      : UBYTE;
  884.     negSize*  : UWORD;          (* number of bytes before library *)
  885.     posSize*  : UWORD;          (* number of bytes after library *)
  886.     version*  : UWORD;          (* major *)
  887.     revision* : UWORD;          (* minor *)
  888.     idString* : STRPTR;         (* ASCII identification *)
  889.     sum*      : ULONG;          (* the checksum itself *)
  890.     openCnt*  : UWORD;          (* number of current opens *)
  891.   END; (* Library *)      (* Warning: size is not a longword multiple! *)
  892.  
  893. CONST
  894.  
  895. (* Flags bit definitions (all others are system reserved) *)
  896.   libSumming   * = 0;      (* we are currently checksumming *)
  897.   libChanged   * = 1;      (* we have just changed the lib *)
  898.   libSumUsed   * = 2;      (* set if we should bother to sum *)
  899.   libDelExp    * = 3;      (* delayed expunge *)
  900.  
  901.  
  902. (*
  903. **      $VER: io.h 39.0 (15.10.91)
  904. **
  905. **      Message structures used for device communication
  906. *)
  907.  
  908.  
  909. TYPE
  910.  
  911.   IORequest* = RECORD (Message)
  912.     device*  : DevicePtr;  (* device node pointer  *)
  913.     unit*    : UnitPtr;    (* unit (driver private)*)
  914.     command* : UWORD;      (* device command *)
  915.     ioFlags* : BSET;
  916.     error*   : SHORTINT;   (* error or warning num *)
  917.   END; (* IORequest *)
  918.  
  919.   IOStdReq* = RECORD (IORequest)
  920.     actual*   : ULONG;      (* actual number of bytes transferred *)
  921.     ioLength* : ULONG;      (* requested number bytes transferred*)
  922.     data*     : APTR;       (* points to data area *)
  923.     offset*   : ULONG;      (* offset for block structured devices *)
  924.   END; (* IOStdReq *)
  925.  
  926. CONST
  927.  
  928. (* library vector offsets for device reserved vectors *)
  929.   devBeginIO    * = -30;
  930.   devAbortIO    * = -36;
  931.  
  932. (* ioFlags defined bits *)
  933.   ioQuick      * = 0;
  934.  
  935.  
  936.   cmdInvalid    * = 0;
  937.   cmdReset      * = 1;
  938.   cmdRead       * = 2;
  939.   cmdWrite      * = 3;
  940.   cmdUpdate     * = 4;
  941.   cmdClear      * = 5;
  942.   cmdStop       * = 6;
  943.   cmdStart      * = 7;
  944.   cmdFlush      * = 8;
  945.  
  946.   cmdNonstd     * = 9;
  947.  
  948. (*
  949. **      $VER: devices.h 39.0 (15.10.91)
  950. **
  951. **      Include file for use by Exec device drivers
  952. *)
  953.  
  954. TYPE
  955.  
  956. (****** Device ******************************************************)
  957.  
  958.   Device* = RECORD (Library) END;
  959.  
  960.  
  961. (****** Unit ********************************************************)
  962.  
  963.   Unit* = RECORD (MsgPort) (* queue for unprocessed messages *)
  964.                            (* instance of msgport is recommended *)
  965.     unitFlags* : BSET;
  966.     unitPad*   : UBYTE;
  967.     openCnt*   : UWORD;    (* number of active opens *)
  968.   END; (* Unit *)
  969.  
  970.  
  971. CONST
  972.  
  973.   unitActive   * = 0;
  974.   unitInTask   * = 1;
  975.  
  976.  
  977. (*
  978. **      $VER: execbase.h 39.6 (18.1.93)
  979. **
  980. **      Definition of the exec.library base structure.
  981. *)
  982.  
  983. TYPE
  984.  
  985. (* Definition of the Exec library base structure (pointed to by location 4).
  986. ** Most fields are not to be viewed or modified by user programs.  Use
  987. ** extreme caution.
  988. *)
  989.   ExecBase* = RECORD (Library)  (* Standard library node *)
  990.  
  991. (******** Static System Variables ********)
  992.  
  993.     softVer*         : UWORD;   (* kickstart release number (obs.) *)
  994.     lowMemChkSum*    : INTEGER; (* checksum of 68000 trap vectors *)
  995.     chkBase*         : ULONG;   (* system base pointer complement *)
  996.     coldCapture*     : APTR;    (* coldstart soft capture vector *)
  997.     coolCapture*     : APTR;    (* coolstart soft capture vector *)
  998.     warmCapture*     : APTR;    (* warmstart soft capture vector *)
  999.     sysStkUpper*     : APTR;    (* system stack base   (upper bound) *)
  1000.     sysStkLower*     : APTR;    (* top of system stack (lower bound) *)
  1001.     maxLocMem*       : APTR;    (* top of chip memory *)
  1002.     debugEntry*      : APTR;    (* global debugger entry point *)
  1003.     debugData*       : APTR;    (* global debugger data segment *)
  1004.     alertData*       : APTR;    (* alert data segment *)
  1005.     maxExtMem*       : APTR;    (* top of extended mem, or null if none *)
  1006.  
  1007.     chkSum*          : UWORD; (* for all of the above (minus 2) *)
  1008.  
  1009. (****** Interrupt Related ***************************************)
  1010.  
  1011.     intVects         : ARRAY 16 OF IntVector;
  1012.  
  1013. (****** Dynamic System Variables *************************************)
  1014.  
  1015.     thisTask*        : TaskPtr; (* pointer to current task (readable) *)
  1016.  
  1017.     idleCount*       : ULONG;   (* idle counter *)
  1018.     dispCount*       : ULONG;   (* dispatch counter *)
  1019.     quantum*         : UWORD;   (* time slice quantum *)
  1020.     elapsed*         : UWORD;   (* current quantum ticks *)
  1021.     sysFlags*        : WSET;    (* misc internal system flags *)
  1022.     idNestCnt*       : SHORTINT;    (* interrupt disable nesting count *)
  1023.     tdNestCnt*       : SHORTINT;    (* task disable nesting count *)
  1024.  
  1025.     attnFlags*       : WSET; (* special attention flags (readable) *)
  1026.  
  1027.     attnResched*     : UWORD;   (* rescheduling attention *)
  1028.     resModules*      : APTR;    (* resident module array pointer *)
  1029.     taskTrapCode*    : PROC;
  1030.     taskExceptCode*  : PROC;
  1031.     taskExitCode*    : PROC;
  1032.     taskSigAlloc*    : SET;
  1033.     taskTrapAlloc*   : WSET;
  1034.  
  1035.  
  1036. (****** System Lists (private!) ********************************)
  1037.  
  1038.     memList-         : List;
  1039.     resourceList-    : List;
  1040.     deviceList-      : List;
  1041.     intrList-        : List;
  1042.     libList-         : List;
  1043.     portList-        : List;
  1044.     taskReady-       : List;
  1045.     taskWait-        : List;
  1046.  
  1047.     softInts         : ARRAY 5 OF SoftIntList;
  1048.  
  1049. (****** Other Globals *******************************************)
  1050.  
  1051.     lastAlert-       : ARRAY 4 OF LONGINT;
  1052.  
  1053.     (* these next two variables are provided to allow
  1054.     ** system developers to have a rough idea of the
  1055.     ** period of two externally controlled signals --
  1056.     ** the time between vertical blank interrupts and the
  1057.     ** external line rate (which is counted by CIA A's
  1058.     ** "time of day" clock).  In general these values
  1059.     ** will be 50 or 60, and may or may not track each
  1060.     ** other.  These values replace the obsolete afbPAL
  1061.     ** and afb50HZ flags.
  1062.     *)
  1063.     vBlankFrequency-      : UBYTE;   (* (readable) *)
  1064.     powerSupplyFrequency- : UBYTE;   (* (readable) *)
  1065.  
  1066.     semaphoreList-   : List;
  1067.  
  1068.     (* these next two are to be able to kickstart into user ram.
  1069.     ** KickMemPtr holds a singly linked list of MemLists which
  1070.     ** will be removed from the memory list via AllocAbs.  If
  1071.     ** all the AllocAbs's succeeded, then the KickTagPtr will
  1072.     ** be added to the rom tag list.
  1073.     *)
  1074.     kickMemPtr*      : APTR;   (* ptr to queue of mem lists *)
  1075.     kickTagPtr*      : APTR;   (* ptr to rom tag queue *)
  1076.     kickCheckSum*    : APTR;   (* checksum for mem and tags *)
  1077.  
  1078. (****** V36 Exec additions start here **************************************)
  1079.  
  1080.     pad0             : UWORD;
  1081.     launchPoint      : ULONG;  (* Private to Launch/Switch *)
  1082.     ramLibPrivate    : APTR;
  1083.     (* The next ULONG contains the system "E" clock frequency,
  1084.     ** expressed in Hertz.  The E clock is used as a timebase for
  1085.     ** the Amiga's 8520 I/O chips. (E is connected to "02").
  1086.     ** Typical values are 715909 for NTSC, or 709379 for PAL.
  1087.     *)
  1088.     eClockFrequency- : ULONG;     (* (readable) *)
  1089.     cacheControl     : APTR;      (* Private to CacheControl calls *)
  1090.     taskID-          : ULONG;     (* Next available task ID *)
  1091.  
  1092.     reserved1        : ARRAY 5 OF ULONG;
  1093.  
  1094.     mmuLock          : APTR;      (* private *)
  1095.  
  1096.     reserved2        : ARRAY 3 OF ULONG;
  1097.  
  1098. (****** V39 Exec additions start here **************************************)
  1099.  
  1100.         (* The following list and data element are used
  1101.          * for V39 exec's low memory handler...
  1102.          *)
  1103.     memHandlers-     :  MinList;  (* The handler list *)
  1104.     memHandler       :  APTR;     (* Private! handler pointer *)
  1105.   END; (* ExecBase *)
  1106.  
  1107.  
  1108. CONST
  1109.  
  1110. (****** Bit defines for AttnFlags (see above) ******************************)
  1111.  
  1112. (*  Processors and Co-processors: *)
  1113.   af68010      * = 0;       (* also set for 68020 *)
  1114.   af68020      * = 1;       (* also set for 68030 *)
  1115.   af68030      * = 2;       (* also set for 68040 *)
  1116.   af68040      * = 3;
  1117.   af68881      * = 4;       (* also set for 68882 *)
  1118.   af68882      * = 5;
  1119.   afFPU40      * = 6;       (* Set if 68040 FPU *)
  1120. (*
  1121.  * The afFPU40 bit is set when a working 68040 FPU
  1122.  * is in the system.  If this bit is set and both the
  1123.  * af68881 and af68882 bits are not set, then the 68040
  1124.  * math emulation code has not been loaded and only 68040
  1125.  * FPU instructions are available.  This bit is valid *ONLY*
  1126.  * if the af68040 bit is set.
  1127.  *)
  1128.  
  1129.   afPrivate    * = 15;      (* Just what it says *)
  1130.  
  1131.  
  1132. (****** Selected flag definitions for Cache manipulation calls **********)
  1133.  
  1134.   cacrEnableI      * = 0;  (* Enable instruction cache *)
  1135.   cacrFreezeI      * = 1;  (* Freeze instruction cache *)
  1136.   cacrClearI       * = 3;  (* Clear instruction cache  *)
  1137.   cacrIBE          * = 4;  (* Instruction burst enable *)
  1138.   cacrEnableD      * = 8;  (* 68030 Enable data cache  *)
  1139.   cacrFreezeD      * = 9;  (* 68030 Freeze data cache  *)
  1140.   cacrClearD       * = 11; (* 68030 Clear data cache   *)
  1141.   cacrDBE          * = 12; (* 68030 Data burst enable *)
  1142.   cacrWriteAllocate* = 13; (* 68030 Write-Allocate mode
  1143.                               (must always be set!)    *)
  1144.   cacrEnableE      * = 30; (* Master enable for external caches *)
  1145.                            (* External caches should track the *)
  1146.                            (* state of the internal caches *)
  1147.                            (* such that they do not cache anything *)
  1148.                            (* that the internal cache turned off *)
  1149.                            (* for. *)
  1150.   cacrCopyBack     * = 31; (* Master enable for copyback caches *)
  1151.  
  1152.   dmaContinue      * = 1;  (* Continuation flag for CachePreDMA *)
  1153.   dmaNoModify      * = 2;  (* Set if DMA does not update memory *)
  1154.   dmaReadFromRAM   * = 3;  (* Set if DMA goes *FROM* RAM to device *)
  1155.  
  1156. (**-- Library base pointer ---------------------------------------------*)
  1157.  
  1158. CONST
  1159.  
  1160.   absExecBase = 4;
  1161.  
  1162. VAR
  1163.  
  1164.   base*, SysBase* : ExecBasePtr;
  1165.  
  1166.  
  1167. (**-- Library functions ------------------------------------------------*)
  1168.  
  1169. (*
  1170. **      $VER: exec_protos.h 39.15 (1.10.93)
  1171. *)
  1172.  
  1173. (* ------ misc ---------------------------------------------------------*)
  1174.  
  1175. LIBCALL (base : ExecBasePtr) Supervisor*
  1176.   ( userFunction [13] : PROC )
  1177.   : APTR;
  1178.   -30;
  1179.  
  1180. (* ------ special patchable hooks to internal exec activity ------------*)
  1181.  
  1182. (* ------ module creation ----------------------------------------------*)
  1183.  
  1184. LIBCALL (base : ExecBasePtr) InitCode*
  1185.   ( startClass [0] : BSET;
  1186.     version    [1] : ULONG );
  1187.   -72;
  1188. LIBCALL (base : ExecBasePtr) InitStruct*
  1189.   ( initTable [9] : APTR;
  1190.     memory   [10] : APTR;
  1191.     size      [0] : ULONG );
  1192.   -78;
  1193. LIBCALL (base : ExecBasePtr) MakeLibrary*
  1194.   ( funcInit   [8] : APTR;
  1195.     structInit [9] : APTR;
  1196.     libInit   [10] : PROC;
  1197.     dataSize   [0] : ULONG;
  1198.     segList    [1] : SYS.BPTR )
  1199.   : LibraryPtr;
  1200.   -84;
  1201. LIBCALL (base : ExecBasePtr) MakeFunctions*
  1202.   ( target        [8] : APTR;
  1203.     functionArray [9] : APTR;
  1204.     funcDispBase [10] : APTR )
  1205.   : ULONG;
  1206.   -90;
  1207. LIBCALL (base : ExecBasePtr) FindResident*
  1208.   ( name [9] : ARRAY OF CHAR )
  1209.   : ResidentPtr;
  1210.   -96;
  1211. LIBCALL (base : ExecBasePtr) InitResident*
  1212.   ( resident [9] : ResidentPtr;
  1213.     segList  [1] : SYS.BPTR )
  1214.   : APTR;
  1215.   -102;
  1216.  
  1217. (* ------ diagnostics --------------------------------------------------*)
  1218.  
  1219. LIBCALL (base : ExecBasePtr) Alert*
  1220.   ( alertNum [7] : ULONG );
  1221.   -108;
  1222. LIBCALL (base : ExecBasePtr) Debug*
  1223.   ( flags [0] : SET );
  1224.   -114;
  1225.  
  1226. (* ------ interrupts ---------------------------------------------------*)
  1227.  
  1228. LIBCALL (base : ExecBasePtr) Disable* ();
  1229.   -120;
  1230. LIBCALL (base : ExecBasePtr) Enable* ();
  1231.   -126;
  1232. LIBCALL (base : ExecBasePtr) Forbid* ();
  1233.   -132;
  1234. LIBCALL (base : ExecBasePtr) Permit* ();
  1235.   -138;
  1236. LIBCALL (base : ExecBasePtr) SetSR*
  1237.   ( newSR [0] : WSET;
  1238.     mask  [1] : WSET )
  1239.   : WSET;
  1240.   -144;
  1241. LIBCALL (base : ExecBasePtr) SuperState* ();
  1242.   -150;
  1243. LIBCALL (base : ExecBasePtr) UserState*
  1244.   ( sysStack [0] : APTR );
  1245.   -156;
  1246. LIBCALL (base : ExecBasePtr) SetIntVector*
  1247.   ( intNumber [0] : ULONG;
  1248.     interrupt [9] : InterruptPtr )
  1249.   : InterruptPtr;
  1250.   -162;
  1251. LIBCALL (base : ExecBasePtr) AddIntServer*
  1252.   ( intNumber [0] : ULONG;
  1253.     interrupt [9] : InterruptPtr );
  1254.   -168;
  1255. LIBCALL (base : ExecBasePtr) RemIntServer*
  1256.   ( intNumber [0] : ULONG;
  1257.     interrupt [9] : InterruptPtr );
  1258.   -174;
  1259. LIBCALL (base : ExecBasePtr) Cause*
  1260.   ( interrupt [9] : InterruptPtr );
  1261.   -180;
  1262.  
  1263. (* ------ memory allocation --------------------------------------------*)
  1264.  
  1265. LIBCALL (base : ExecBasePtr) Allocate*
  1266.   ( freeList [8] : MemHeaderPtr;
  1267.     byteSize [0] : ULONG )
  1268.   : APTR;
  1269.   - 186;
  1270. LIBCALL (base : ExecBasePtr) Deallocate*
  1271.   ( freeList    [8] : MemHeaderPtr;
  1272.     memoryBlock [9] : APTR;
  1273.     byteSize    [0] : ULONG );
  1274.   -192;
  1275. LIBCALL (base : ExecBasePtr) AllocMem*
  1276.   ( byteSize     [0] : ULONG;
  1277.     requirements [1] : SET )
  1278.   : APTR;
  1279.   - 198;
  1280. LIBCALL (base : ExecBasePtr) AllocAbs*
  1281.   ( byteSize [0] : ULONG;
  1282.     location [1] : APTR )
  1283.   : APTR;
  1284.   - 204;
  1285. LIBCALL (base : ExecBasePtr) FreeMem*
  1286.   ( memoryBlock [9] : APTR;
  1287.     byteSize    [0] : ULONG );
  1288.   - 210;
  1289. LIBCALL (base : ExecBasePtr) AvailMem*
  1290.   ( requirements [1] : SET )
  1291.   : ULONG;
  1292.   - 216;
  1293. LIBCALL (base : ExecBasePtr) AllocEntry*
  1294.   ( entry [8] : APTR )
  1295.   : APTR;
  1296.   - 222;
  1297. LIBCALL (base : ExecBasePtr) FreeEntry*
  1298.   ( entry [8] : APTR );
  1299.   - 228;
  1300.  
  1301. (* ------ lists --------------------------------------------------------*)
  1302.  
  1303. LIBCALL (base : ExecBasePtr) Insert*
  1304.   ( VAR list [8] : MinList;
  1305.     node     [9] : MinNodePtr;
  1306.     pred    [10] : MinNodePtr );
  1307.   - 234;
  1308. LIBCALL (base : ExecBasePtr) AddHead*
  1309.   ( VAR list [8] : MinList;
  1310.     node     [9] : MinNodePtr );
  1311.   - 240;
  1312. LIBCALL (base : ExecBasePtr) AddTail*
  1313.   ( VAR list [8] : MinList;
  1314.     node     [9] : MinNodePtr );
  1315.   - 246;
  1316. LIBCALL (base : ExecBasePtr) Remove*
  1317.   ( node [9] : MinNodePtr );
  1318.   - 252;
  1319. LIBCALL (base : ExecBasePtr) RemHead*
  1320.   ( VAR list [8] : MinList )
  1321.   : MinNodePtr;
  1322.   - 258;
  1323. LIBCALL (base : ExecBasePtr) RemHeadNode*
  1324.   ( VAR list [8] : MinList )
  1325.   : NodePtr;
  1326.   - 258;
  1327. LIBCALL (base : ExecBasePtr) RemTail*
  1328.   ( VAR list [8] : MinList )
  1329.   : MinNodePtr;
  1330.   - 264;
  1331. LIBCALL (base : ExecBasePtr) RemTailNode*
  1332.   ( VAR list [8] : MinList )
  1333.   : NodePtr;
  1334.   - 264;
  1335. LIBCALL (base : ExecBasePtr) Enqueue*
  1336.   ( VAR list [8] : MinList;
  1337.     node     [9] : NodePtr );
  1338.   - 270;
  1339. LIBCALL (base : ExecBasePtr) FindName*
  1340.   ( VAR list [8] : MinList;
  1341.     name     [9] : ARRAY OF CHAR )
  1342.   : NodePtr;
  1343.   - 276;
  1344. LIBCALL (base : ExecBasePtr) FindNameNode*
  1345.   ( node [8] : NodePtr;
  1346.     name [9] : ARRAY OF CHAR )
  1347.   : NodePtr;
  1348.   - 276;
  1349.  
  1350. (* ------ tasks --------------------------------------------------------*)
  1351.  
  1352. LIBCALL (base : ExecBasePtr) AddTask*
  1353.   ( task     [9] : TaskPtr;
  1354.     initPC  [10] : PROC;
  1355.     finalPC [11] : APTR );
  1356.   - 282;
  1357. LIBCALL (base : ExecBasePtr) NewAddTask*
  1358.   ( task     [9] : TaskPtr;
  1359.     initPC  [10] : PROC;
  1360.     finalPC [11] : APTR )
  1361.   : APTR;
  1362.   - 282;
  1363. LIBCALL (base : ExecBasePtr) RemTask*
  1364.   ( task [9] : TaskPtr );
  1365.   - 288;
  1366. LIBCALL (base : ExecBasePtr) FindTask*
  1367.   ( name [9] : STRPTR )
  1368.   : TaskPtr;
  1369.   - 294;
  1370. LIBCALL (base : ExecBasePtr) SetTaskPri*
  1371.   ( task     [9] : TaskPtr;
  1372.     priority [0] : LONGINT )
  1373.   : SHORTINT;
  1374.   - 300;
  1375. LIBCALL (base : ExecBasePtr) SetSignal*
  1376.   ( newSignals [0] : SET;
  1377.     signalSet  [1] : SET )
  1378.   : SET;
  1379.   - 306;
  1380. LIBCALL (base : ExecBasePtr) SetExcept*
  1381.   ( newSignals [0] : SET;
  1382.     signalSet  [1] : SET )
  1383.   : SET;
  1384.   - 312;
  1385. LIBCALL (base : ExecBasePtr) Wait*
  1386.   ( signalSet [0] : SET )
  1387.   : SET;
  1388.   - 318;
  1389. LIBCALL (base : ExecBasePtr) Signal*
  1390.   ( task      [9] : TaskPtr;
  1391.     signalSet [0] : SET );
  1392.   - 324;
  1393. LIBCALL (base : ExecBasePtr) AllocSignal*
  1394.   ( signalNum [0] : LONGINT )
  1395.   : SHORTINT;
  1396.   - 330;
  1397. LIBCALL (base : ExecBasePtr) FreeSignal*
  1398.   ( signalNum [0] : LONGINT );
  1399.   - 336;
  1400. LIBCALL (base : ExecBasePtr) AllocTrap*
  1401.   ( trapNum [0] : LONGINT )
  1402.   : SHORTINT;
  1403.   - 342;
  1404. LIBCALL (base : ExecBasePtr) FreeTrap*
  1405.   ( trapNum [0] : LONGINT );
  1406.   - 348;
  1407.  
  1408. (* ------ messages -----------------------------------------------------*)
  1409.  
  1410. LIBCALL (base : ExecBasePtr) AddPort*
  1411.   ( port [9] : MsgPortPtr );
  1412.   - 354;
  1413. LIBCALL (base : ExecBasePtr) RemPort*
  1414.   ( port [9] : MsgPortPtr );
  1415.   - 360;
  1416. LIBCALL (base : ExecBasePtr) PutMsg*
  1417.   ( port    [8] : MsgPortPtr;
  1418.     message [9] : MessagePtr );
  1419.   - 366;
  1420. LIBCALL (base : ExecBasePtr) GetMsg*
  1421.   ( port [8] : MsgPortPtr )
  1422.   : MessagePtr;
  1423.   - 372;
  1424. LIBCALL (base : ExecBasePtr) ReplyMsg*
  1425.   ( message [9] : MessagePtr );
  1426.   - 378;
  1427. LIBCALL (base : ExecBasePtr) WaitPort*
  1428.   ( port [8] : MsgPortPtr );
  1429.   - 384;
  1430. LIBCALL (base : ExecBasePtr) FindPort*
  1431.   ( name [9] : ARRAY OF CHAR )
  1432.   : MsgPortPtr;
  1433.   - 390;
  1434.  
  1435. (* ------ libraries ----------------------------------------------------*)
  1436.  
  1437. LIBCALL (base : ExecBasePtr) AddLibrary*
  1438.   ( library [9] : LibraryPtr );
  1439.   - 396;
  1440. LIBCALL (base : ExecBasePtr) RemLibrary*
  1441.   ( library [9] : LibraryPtr );
  1442.   - 402;
  1443. LIBCALL (base : ExecBasePtr) OldOpenLibrary*
  1444.   ( libName [9] : ARRAY OF CHAR )
  1445.   : LibraryPtr;
  1446.   - 408;
  1447. LIBCALL (base : ExecBasePtr) CloseLibrary*
  1448.   ( library [9] : LibraryPtr );
  1449.   - 414;
  1450. LIBCALL (base : ExecBasePtr) SetFunction*
  1451.   ( library     [9] : LibraryPtr;
  1452.     funcOffset  [8] : LONGINT;
  1453.     newFunction [0] : PROC )
  1454.   : PROC;
  1455.   - 420;
  1456. LIBCALL (base : ExecBasePtr) SumLibrary*
  1457.   ( library [9] : LibraryPtr );
  1458.   - 426;
  1459.  
  1460. (* ------ devices ------------------------------------------------------*)
  1461.  
  1462. LIBCALL (base : ExecBasePtr) AddDevice*
  1463.   ( device [9] : DevicePtr );
  1464.   - 432;
  1465. LIBCALL (base : ExecBasePtr) RemDevice*
  1466.   ( device [9] : DevicePtr );
  1467.   - 438;
  1468. LIBCALL (base : ExecBasePtr) OpenDevice*
  1469.   ( devName   [8] : ARRAY OF CHAR;
  1470.     unit      [0] : ULONG;
  1471.     ioRequest [9] : MessagePtr;
  1472.     flags     [1] : SET )
  1473.   : SHORTINT;
  1474.   - 444;
  1475. LIBCALL (base : ExecBasePtr) CloseDevice*
  1476.   ( ioRequest [9] : MessagePtr );
  1477.   - 450;
  1478. LIBCALL (base : ExecBasePtr) DoIO*
  1479.   ( ioRequest [9] : MessagePtr )
  1480.   : SHORTINT;
  1481.   - 456;
  1482. LIBCALL (base : ExecBasePtr) OldDoIO*
  1483.   ( ioRequest [9] : MessagePtr );
  1484.   - 456;
  1485. LIBCALL (base : ExecBasePtr) SendIO*
  1486.   ( ioRequest [9] : MessagePtr );
  1487.   - 462;
  1488. LIBCALL (base : ExecBasePtr) CheckIO*
  1489.   ( ioRequest [9] : MessagePtr )
  1490.   : IORequestPtr;
  1491.   - 468;
  1492. LIBCALL (base : ExecBasePtr) WaitIO*
  1493.   ( ioRequest [9] : MessagePtr )
  1494.   : SHORTINT;
  1495.   - 474;
  1496. LIBCALL (base : ExecBasePtr) OldWaitIO*
  1497.   ( ioRequest [9] : MessagePtr );
  1498.   - 474;
  1499. LIBCALL (base : ExecBasePtr) AbortIO*
  1500.   ( ioRequest [9] : MessagePtr );
  1501.   - 480;
  1502.  
  1503. (* ------ resources ----------------------------------------------------*)
  1504.  
  1505. LIBCALL (base : ExecBasePtr) AddResource*
  1506.   ( resource [9] : APTR );
  1507.   - 486;
  1508. LIBCALL (base : ExecBasePtr) RemResource*
  1509.   ( resource [9] : APTR );
  1510.   - 492;
  1511. LIBCALL (base : ExecBasePtr) OpenResource*
  1512.   ( resName [9] : ARRAY OF CHAR )
  1513.   : APTR;
  1514.   - 498;
  1515.  
  1516. (* ------ private diagnostic support -----------------------------------*)
  1517.  
  1518. (* ------ misc ---------------------------------------------------------*)
  1519.  
  1520. LIBCALL (base : ExecBasePtr) RawDoFmt*
  1521.   ( formatString [8] : ARRAY OF CHAR;
  1522.     dataStream   [9] : APTR;
  1523.     putChProc   [10] : PROC;
  1524.     putChData   [11] : APTR )
  1525.     : APTR;
  1526.   - 522;
  1527. LIBCALL (base : ExecBasePtr) RawDoFmtL*
  1528.   ( formatString [8] : ARRAY OF CHAR;
  1529.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1530.     putChProc   [10] : PROC;
  1531.     putChData   [11] : APTR )
  1532.     : APTR;
  1533.   - 522;
  1534. LIBCALL (base : ExecBasePtr) OldRawDoFmt*
  1535.   ( formatString [8] : ARRAY OF CHAR;
  1536.     dataStream   [9] : APTR;
  1537.     putChProc   [10] : PROC;
  1538.     putChData   [11] : APTR );
  1539.   - 522;
  1540. LIBCALL (base : ExecBasePtr) OldRawDoFmtL*
  1541.   ( formatString [8] : ARRAY OF CHAR;
  1542.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1543.     putChProc   [10] : PROC;
  1544.     putChData   [11] : APTR );
  1545.   - 522;
  1546. LIBCALL (base : ExecBasePtr) GetCC* ()
  1547.   : WSET;
  1548.   - 528;
  1549. LIBCALL (base : ExecBasePtr) TypeOfMem*
  1550.   ( address [9] : APTR )
  1551.   : SET;
  1552.   - 534;
  1553. LIBCALL (base : ExecBasePtr) Procure*
  1554.   ( VAR semaphore [8] : Semaphore;
  1555.     bidMsg        [9] : MessagePtr )
  1556.   : BOOLEAN;
  1557.   - 540;
  1558. LIBCALL (base : ExecBasePtr) Vacate*
  1559.   ( VAR semaport [8] : Semaphore );
  1560.   - 546;
  1561. LIBCALL (base : ExecBasePtr) OpenLibrary*
  1562.   ( libName [9] : ARRAY OF CHAR;
  1563.     version [0] : ULONG )
  1564.   : LibraryPtr;
  1565.   - 552;
  1566.  
  1567. (* --- functions in V33 or higher (distributed as Release 1.2) ---*)
  1568.  
  1569. (* ------ signal semaphores (note funny registers)----------------------*)
  1570.  
  1571. LIBCALL (base : ExecBasePtr) InitSemaphore*
  1572.   ( VAR sigSem [8] : SignalSemaphore );
  1573.   - 558;
  1574. LIBCALL (base : ExecBasePtr) ObtainSemaphore*
  1575.   ( VAR sigSem [8] : SignalSemaphore );
  1576.   - 564;
  1577. LIBCALL (base : ExecBasePtr) ReleaseSemaphore*
  1578.   ( VAR sigSem [8] : SignalSemaphore );
  1579.   - 570;
  1580. LIBCALL (base : ExecBasePtr) AttemptSemaphore*
  1581.   ( VAR sigSem [8] : SignalSemaphore )
  1582.   : BOOLEAN;
  1583.   - 576;
  1584. LIBCALL (base : ExecBasePtr) ObtainSemaphoreList*
  1585.   ( VAR sigSem [8] : List );
  1586.   - 582;
  1587. LIBCALL (base : ExecBasePtr) ReleaseSemaphoreList*
  1588.   ( VAR sigSem [8] : List );
  1589.   - 588;
  1590. LIBCALL (base : ExecBasePtr) FindSemaphore*
  1591.   ( sigSem [9] : ARRAY OF CHAR )
  1592.   : SignalSemaphorePtr;
  1593.   - 594;
  1594. LIBCALL (base : ExecBasePtr) AddSemaphore*
  1595.   ( VAR sigSem [9] : SignalSemaphore );
  1596.   - 600;
  1597. LIBCALL (base : ExecBasePtr) RemSemaphore*
  1598.   ( VAR sigSem [9] : SignalSemaphore );
  1599.   - 606;
  1600.  
  1601. (* ------ kickmem support ----------------------------------------------*)
  1602.  
  1603. LIBCALL (base : ExecBasePtr) SumKickData* ()
  1604.   : ULONG;
  1605.   - 612;
  1606.  
  1607. (* ------ more memory support ------------------------------------------*)
  1608.  
  1609. LIBCALL (base : ExecBasePtr) AddMemList*
  1610.   ( size       [0] : ULONG;
  1611.     attributes [1] : SET;
  1612.     pri        [2] : LONGINT;
  1613.     memBase    [8] : APTR;
  1614.     name       [9] : ARRAY OF CHAR );
  1615.   - 618;
  1616. LIBCALL (base : ExecBasePtr) CopyMem*
  1617.   ( source [8] : ARRAY OF SYS.BYTE;
  1618.     dest   [9] : ARRAY OF SYS.BYTE;
  1619.     size   [0] : ULONG );
  1620.   - 624;
  1621. LIBCALL (base : ExecBasePtr) CopyMemAPTR*
  1622.   ( source [8] : APTR;
  1623.     dest   [9] : APTR;
  1624.     size   [0] : ULONG );
  1625.   - 624;
  1626. LIBCALL (base : ExecBasePtr) CopyMemQuick*
  1627.   ( source [8] : ARRAY OF SYS.BYTE;
  1628.     dest   [9] : ARRAY OF SYS.BYTE;
  1629.     size   [0] : ULONG );
  1630.   - 630;
  1631. LIBCALL (base : ExecBasePtr) CopyMemQuickAPTR*
  1632.   ( source [8] : APTR;
  1633.     dest   [9] : APTR;
  1634.     size   [0] : ULONG );
  1635.   - 630;
  1636.  
  1637. (* ------ cache --------------------------------------------------------*)
  1638.  
  1639. (* --- functions in V36 or higher (distributed as Release 2.0) ---*)
  1640.  
  1641. LIBCALL (base : ExecBasePtr) CacheClearU* ();
  1642.   - 636;
  1643. LIBCALL (base : ExecBasePtr) CacheClearE*
  1644.   ( address [8] : APTR;
  1645.     length  [0] : ULONG;
  1646.     caches  [1] : SET );
  1647.   - 642;
  1648. LIBCALL (base : ExecBasePtr) CacheControl*
  1649.   ( cacheBits [0] : SET;
  1650.     cacheMask [1] : SET )
  1651.   : SET;
  1652.   - 648;
  1653.  
  1654. (* ------ misc ---------------------------------------------------------*)
  1655.  
  1656. LIBCALL (base : ExecBasePtr) CreateIORequest*
  1657.   ( port [8] : MsgPortPtr;
  1658.     size [0] : ULONG )
  1659.   : MessagePtr;
  1660.   - 654;
  1661. LIBCALL (base : ExecBasePtr) DeleteIORequest*
  1662.   ( iorequest [8] : MessagePtr );
  1663.   - 660;
  1664. LIBCALL (base : ExecBasePtr) CreateMsgPort* ()
  1665.   : MsgPortPtr;
  1666.   - 666;
  1667. LIBCALL (base : ExecBasePtr) DeleteMsgPort*
  1668.   ( port [8] : MsgPortPtr );
  1669.   - 672;
  1670. LIBCALL (base : ExecBasePtr) ObtainSemaphoreShared*
  1671.   ( VAR sigSem [8] : SignalSemaphore );
  1672.   - 678;
  1673.  
  1674. (* ------ even more memory support -------------------------------------*)
  1675.  
  1676. LIBCALL (base : ExecBasePtr) AllocVec*
  1677.   ( byteSize     [0] : ULONG;
  1678.     requirements [1] : SET )
  1679.   : APTR;
  1680.   - 684;
  1681. LIBCALL (base : ExecBasePtr) FreeVec*
  1682.   ( memoryBlock [9] : APTR );
  1683.   - 690;
  1684. LIBCALL (base : ExecBasePtr) CreatePrivatePool*
  1685.   ( requirements [0] : SET;
  1686.     puddleSize   [1] : ULONG;
  1687.     puddleThresh [2] : ULONG )
  1688.   : APTR;
  1689.   - 696;
  1690. LIBCALL (base : ExecBasePtr) DeletePrivatePool*
  1691.   ( poolHeader [8] : APTR );
  1692.   - 702;
  1693. LIBCALL (base : ExecBasePtr) AllocPooled*
  1694.   ( poolHeader [8] : APTR;
  1695.     memSize    [0] : ULONG )
  1696.   : APTR;
  1697.   - 708;
  1698. LIBCALL (base : ExecBasePtr) FreePooled*
  1699.   ( poolHeader [8] : APTR;
  1700.     memory     [9] : APTR );
  1701.   - 714;
  1702.  
  1703. (* ------ misc ---------------------------------------------------------*)
  1704.  
  1705. LIBCALL (base : ExecBasePtr) AttemptSemaphoreShared*
  1706.   ( VAR sigSem [8] : SignalSemaphore )
  1707.   : ULONG;
  1708.   - 720;
  1709. LIBCALL (base : ExecBasePtr) ColdReboot* ();
  1710.   - 726;
  1711. LIBCALL (base : ExecBasePtr) StackSwap*
  1712.   ( VAR newStack [8] : StackSwapStruct );
  1713.   - 732;
  1714.  
  1715. (* ------ task trees ---------------------------------------------------*)
  1716.  
  1717. LIBCALL (base : ExecBasePtr) ChildFree*
  1718.   ( tid [0] : APTR );
  1719.   - 738;
  1720. LIBCALL (base : ExecBasePtr) ChildOrphan*
  1721.   ( tid [0] : APTR );
  1722.   - 744;
  1723. LIBCALL (base : ExecBasePtr) ChildStatus*
  1724.   ( tid [0] : APTR );
  1725.   - 750;
  1726. LIBCALL (base : ExecBasePtr) ChildWait*
  1727.   ( tid [0] : APTR );
  1728.   - 756;
  1729.  
  1730. (* ------ future expansion ---------------------------------------------*)
  1731.  
  1732. LIBCALL (base : ExecBasePtr) CachePreDMA*
  1733.   ( address    [8] : APTR;
  1734.     VAR length [9] : ULONG;
  1735.     flags      [0] : ULONG )
  1736.   : APTR;
  1737.   - 762;
  1738. LIBCALL (base : ExecBasePtr) CachePostDMA*
  1739.   ( address    [8] : APTR;
  1740.     VAR length [9] : ULONG;
  1741.     flags      [0] : ULONG );
  1742.   - 768;
  1743.  
  1744. (*------ New, for V39*)
  1745.  
  1746. (*--- functions in V39 or higher (Release 3) ---*)
  1747.  
  1748. (*------ Low memory handler functions*)
  1749.  
  1750. LIBCALL (base : ExecBasePtr) AddMemHandler  *
  1751.   ( memhand [9] : InterruptPtr );
  1752.   -774;
  1753. LIBCALL (base : ExecBasePtr) RemMemHandler  *
  1754.   ( memhand [9] : InterruptPtr );
  1755.   -780;
  1756.  
  1757. (*------ Function to attempt to obtain a Quick Interrupt Vector...*)
  1758.  
  1759. LIBCALL (base : ExecBasePtr) ObtainQuickVector  *
  1760.   ( interruptCode [8] : PROC )
  1761.   : ULONG;
  1762.   -786;
  1763.  
  1764. (**-- C Macros defined as procedures -----------------------------------*)
  1765. (** $L+ Absolute long addressing for globals *)
  1766.  
  1767. (*
  1768.  *      Check for the presence of any nodes on the given list.  These
  1769.  *      macros are even safe to use on lists that are modified by other
  1770.  *      tasks.  However; if something is simultaneously changing the
  1771.  *      list, the result of the test is unpredictable.
  1772.  *
  1773.  *      Unless you first arbitrated for ownership of the list, you can't
  1774.  *      depend on the contents of the list.  Nodes might have been added
  1775.  *      or removed during or after the macro executes.
  1776.  *
  1777.  *              if( IsListEmpty(list) )         printf("List is empty\n");
  1778.  *)
  1779.  
  1780.  
  1781. (**-----------------------------------*)
  1782. PROCEDURE IsListEmpty* (VAR x : MinList) : BOOLEAN;
  1783. BEGIN (* IsListEmpty *)
  1784.   RETURN (x.head.succ = NIL)
  1785. END IsListEmpty;
  1786.  
  1787. (**-----------------------------------*)
  1788. PROCEDURE IsMsgPortEmpty* (x : MsgPortPtr) : BOOLEAN;
  1789. BEGIN (* IsMsgPortEmpty *)
  1790.   RETURN (x.msgList.head.succ = NIL)
  1791. END IsMsgPortEmpty;
  1792.  
  1793.  
  1794. (**----- Module initialisation ----------------------------------------*)
  1795. (** $L- address globals through A4 *)
  1796.  
  1797.  
  1798. BEGIN
  1799.   SYS.GET (absExecBase, base); SysBase := base
  1800. END Exec.
  1801.